namespace java.swift net.gdface.sdk.decorator
namespace cpp gdface
namespace java net.gdface.sdk.thrift
namespace py gdface.thrift



struct FAngle {
  1: required double confidence;
  2: required i32 pitch;
  3: required i32 roll;
  4: required i32 yaw;
}

struct EyeInfo {
  1: required i32 leftx;
  2: required i32 lefty;
  3: required i32 rightx;
  4: required i32 righty;
}

struct FInt2 {
  1: required i32 x;
  2: required i32 y;
}

struct FRect {
  1: required i32 height;
  2: required i32 left;
  3: required i32 top;
  4: required i32 width;
}

exception ImageErrorException {
  1:  string message;
  2:  string causeClass;
  3:  string serviceStackTraceMessage;
  4:  string causeFields;
}

exception NotFaceDetectedException {
  1:  string message;
  2:  string causeClass;
  3:  string serviceStackTraceMessage;
  4:  string causeFields;
  5: required i32 codeNum;
  6: required i32 faceNum;
}

exception ServiceRuntimeException {
  1:  string message;
  2:  string causeClass;
  3:  string serviceStackTraceMessage;
  4:  string causeFields;
  5: required i32 type;
}

struct CodeInfo {
  1:  FAngle angle;
  2:  binary code;
  3:  EyeInfo ei;
  4:  binary facialData;
  5:  FInt2 mouth;
  6:  FInt2 nose;
  7:  FRect pos;
}

service FaceApi {
  double compare2Face(1:  binary imgData1, 2:  CodeInfo facePos1, 3:  binary imgData2, 4:  CodeInfo facePos2) throws (1: ImageErrorException ex1, 2: NotFaceDetectedException ex2, 3: ServiceRuntimeException ex3);
  double compareCode(1:  binary code1, 2:  binary code2) throws (1: ServiceRuntimeException ex1);
  list<double> compareCodes(1:  binary code1, 2:  list<CodeInfo> codes) throws (1: ServiceRuntimeException ex1);
  list<double> compareFeatures(1:  binary code1, 2:  list<binary> codes) throws (1: ServiceRuntimeException ex1);
  double detectAndCompare2Face(1:  binary imgData1, 2:  FRect detectRect1, 3:  binary imgData2, 4:  FRect detectRect2) throws (1: ImageErrorException ex1, 2: NotFaceDetectedException ex2, 3: ServiceRuntimeException ex3);
  list<CodeInfo> detectAndGetCodeInfo(1:  binary imgData, 2: required i32 faceNum, 3:  FRect detectRectangle) throws (1: ImageErrorException ex1, 2: NotFaceDetectedException ex2, 3: ServiceRuntimeException ex3);
  CodeInfo detectCenterFace(1:  binary imgData) throws (1: ImageErrorException ex1, 2: NotFaceDetectedException ex2, 3: ServiceRuntimeException ex3);
  list<CodeInfo> detectFace(1:  binary imgData, 2:  FRect detectRectangle) throws (1: ImageErrorException ex1, 2: ServiceRuntimeException ex2);
  list<CodeInfo> detectFaceAgain(1:  binary imgData, 2:  list<FRect> detectRects) throws (1: ServiceRuntimeException ex1);
  list<CodeInfo> getCodeInfo(1:  binary imgData, 2: required i32 faceNum, 3:  list<CodeInfo> facePos) throws (1: NotFaceDetectedException ex1, 2: ServiceRuntimeException ex2);
  binary getFeature(1:  map<binary, CodeInfo> faces) throws (1: NotFaceDetectedException ex1, 2: ServiceRuntimeException ex2);
  bool hasFace(1:  binary imgData, 2:  FRect detectRectangle) throws (1: ImageErrorException ex1, 2: ServiceRuntimeException ex2);
  bool isLocal() throws (1: ServiceRuntimeException ex1);
  bool multiFaceFeature() throws (1: ServiceRuntimeException ex1);
}
